package com.zjs.jsp.fdservice.service;

import com.zjs.jsp.domain.config.Param;
import com.zjs.jsp.domain.config.ParamList;
import com.zjs.jsp.domain.config.ShopCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

/**
 * 配置文件获取类
 *
 * @author 李文
 * @create 2017-09-04 20:11
 **/
@Component
@CacheConfig(cacheNames = "cusotmerdata")
public class ConfigService
{
    @Autowired
    private ConfigClientService clientService;

    @Cacheable
    public Param getParamList() {
        ParamList s = clientService.getParamList();
        return s.toParam();
    }

    /**
     * 获取PK
     *
     * @param shopCode 门店编码
     * @return PK
     */
    @Cacheable
    public String getPkCorpByShopCode(String shopCode) {
        ShopCode s = clientService.getPkCorpByShopCode(shopCode);
        return s.getData();
    }

    public String getCorpFdInfo(String pk) {
        ShopCode s = clientService.getCorpFdInfo(pk);
        return s.getData();
    }


}
